Semiconductor memory cards with a nonvolatile built-in memory device have become commonly available as a recording medium for not only personal computers or digital still cameras but also digital video cameras and so on.
With the digitalization of or a development in the high definition (HD) technique for television broadcasting in recent years, larger capacity and higher speed have been required for semiconductor memory cards.
A flash memory is generally used in many semiconductor memory cards. The flash memory is a recording medium in which a block is the smallest unit for erasing. More specifically, the flash memory has a feature that a given sized data called an erase block is electrically erased collectively.
When updating data which is recorded on a recording medium in which the block is the smallest unit for erasing, and which is smaller than the block size, the following operation is carried out.
Entire data in a block including the data is once read and held, and then the data recorded in the block is erased collectively. Then, the data that has been held is partially updated and the updated data is written back to the block.
Such an operation is called a read-modify-write operation. The read-modify-write operation leads to a complicated recording operation and a lowered transmission rate in recording.
Meanwhile, it has become general, in apparatuses such as digital video cameras which record video signals and audio signals, to convert video signals and the like into a file format and record them on a recording medium.
Data format adopted for digital video cameras includes, for example, DVCPRO-HD compressed data that complies with the SMPTE370M standard, and a file format includes a MXF file that complies with the SMPTE377M.
The material exchange format (MXF) is a format used for exchanging materials and standardized by the SMPTE and enables passing data between a digital device unique to a manufacture and a digital device of other manufactures.
FIG. 1 is a diagram which shows a configuration of a video file and an audio file.
FIG. 1(a) shows a configuration of a video MXF file in the DVCPRO-HD video data format.
Compressed video data (DIF) is stored in a body of a KLV configuration following a file header. A DIF coding amount for one frame is 480,000 bytes according to the DVCPRO-HD. Accordingly, a coding amount of the body for recording N frames is N times the coding amount for one frame described above.
FIG. 1(b) shows a configuration of an audio MXF file in a waveform audio data format.
The audio data of 16 bits per one sample is stored in a body of a KLV configuration following a file header. Accordingly, the coding amount of the body at the time of recording M samples is M×2 bytes.
In addition, a type of data that has been recorded is stored in the K (Key) section of the KLV configuration, and a size of data is stored in the L (Length) section.
In the Key section of the video MXF file, the type of data and a frame frequency are stored. In the Key section of the audio MXF file, the type of data and, a sampling frequency, and the number of bits are stored.
In the case of the video file, for example, information indicating the DVCPRO-HD, the NTSC, and an interlace is stored in the Key section. In the case of the audio file, information indicating a waveform, 48 kHz, and 16 bits is stored in the Key section.
Hereinafter, the file header and the K and L sections are collectively called a header section, and the body following the K and L sections is called a data section, and the file footer is called a footer section.
As described above, the data size of the file is stored in the Length section of the header section. However, in the case where a signal stream is recorded, such as the case of a digital video camera, the data size is not determined until the end of recording.
Thus, writing into the Length section needs to be carried out at the time when recording ends. On the other hand, the header section exists at the beginning of a file, so that the header section needs to be recorded first at the time when recording starts.
For that reason, the Length section is determined as “0” and the header section is recorded prior to the data section, so that data that has been recorded halfway is restored based on the information of the header section even when the power is shut off during the recording.
In such a case, at the time of end of recording of the video and audio files, the Length section of the header section is rewritten to a correct a value. That is to say, the read-modify-write operation described above is carried out.
It is to be noted that, in sections other than the header section, the read-modify-write operation is not carried out because writing is performed by a unit of the integral multiple of the erase block.
FIG. 2 is a diagram which shows a recording method disclosed in Patent Reference 1.
Here, an example of a state of a physical block and an example of a logical and physical table is shown. As shown in FIG. 2(a), the block at a physical address 10 includes a cluster 1 and a cluster 2, and data is recorded on each of the clusters.
It is described in the logical and physical table that the block at the physical address 10 is associated with the logical address “0x240”.
It is assumed here that a data writing instruction on the cluster 1 is issued. In this case, the physical block 10 including the cluster 1 also includes the cluster 2. For that reason, data of a new cluster 1 is written into a free block at the physical address 11 as shown in FIG. 2 (b).
Then, the data of the cluster 2 is copied from the physical block 10 to the physical block 11, and the physical address corresponding to the logical address “0x240” of the logical and physical table is updated from “10” to “11”. Further, the data of the physical block 10 is erased to make the physical block 10 a free block.    Patent Reference 1: Japanese Unexamined Patent Application Publication No. 2006-048227